import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Link from "../components/router/Link";
import {Post} from "../components/posts/Post";
import Ad from "../components/ad/Ad";

export class SinglePost extends Component{
  static propTypes = {
    params: PropTypes.shape({
      postId: PropTypes.string.isRequired
    })
  };



  render() {
    console.log('post')
    return (
        <div className="single-post">
          <Link to="/">
            <div className="back">
              <span><i className="fa fa-arrow-left" /> 返回首页</span>
            </div>
          </Link>
          <Post id={this.props.params.postId} />
          <Ad url="https://www.manning.com/books/react-in-action"
              imageUrl={`${process.env.REACT_APP_SERVE}/static/assets/ads/ria.png`}
          />
        </div>
    );
  }
}
